Error in JS, removed extra character