fixed error when deleting last entry