Moved the onClick handler inside the router