fixing javascript no method error in asset debug mode.
fixing javascript errors in states and others