fixed button switching bug