some js code formatting fixes