Corrected generated js code