fixed crash that occured when deleting last record