Put click event inside the try/catch