handling JSON load errors
improving error reporting