checking exceptions