Added try and catch to the exception to prevent the dying of code.
Accidentally deleted some code.