Fix for getting error object from json