commit before swapping buttons