Added a try and catch for safety.