click function updated to support Chrome