Added lock for click event