Switch mode script