fixed delete_by generation problem