try and catch for json parse