improved parsing (global json variable)