2of3 function for modbutton