regulate the on click event