Added exception handle for debugging purposes