Fixed typo and improved switchCSS js method