fixed switching and display bugs