catch the exceptions