fixing js example