Using on() function instead of click()