Fixed build error due to malformed JavaScript

Updated init code