I had the same when I fitted a stove, problem with tar from wood running back down which is caused by too large a flue size causing gases to be to cold, solution installed a stainless steel flue never had the problem again but remember to use seasoned wood.