fixed click event and other code