eliminate confusing local variable 'json' with imported library
Merge pull request #324 from kevmoo/master

Fixed crash in error handling flow