Added a fix for general exception handling