fix mess in js code