switching bug fixed