handle exception universally