Made a better click event for the layout switcher button