Added globasl exception handler