minor chnages to better handle json parser exceptions