handle exceptions and configurations