Added onclick events to trigger sorting