Fixed the javascript changeStateModule