fixed js bugs.