fixed broken layout switching