exception handling fix