fixed bugs on .js