error handling, exception and registration