cleaned exception handling