Had a bug in the click function