correct js code