added a state variable on UIbutton object, changed type of function menu click