fixed resultSet count check