reformat and fixed button highlight after switching window