beginning of on click