fixed errors catching/raising