JSON javascript fix

Fixed Simon's javascript bug