Added a better exception handling system