added another public method for handling row selection