finished dynamic exception handling