update on click function