clean up exception handling