enhanced js and bug fixing.