fix bug when deleting data and there are no topics yet