Handling row selection in main tableview.