removed unnecessary row count check