clean error handling.