changed json into js globals