updated js example