fix row count bug