testing on click funciton for flag