Fixing bug in js files