Fixed update method to use rowCount