Exception handling on parseJSON