fixing JS code style mistakes