finish row count function