added row_count check