Updated to newst JS API of the engine