updated js code style