fixes #4 - added try catch around JSON.parse