remove extra { in javascript