Improves exception handling