fixed exceptions catching