Handle timeouts properly