catching excpetions