fixed bugs, split js to single file.