Fix js code for tutorial