add timeout to click function