next try at fixing timeouts and close_connection