this click hanlder is very close to the case where the user uses the sort button, it would be better to define a function taking the uri in parameter and to call it in both case in the click handler.