use get_connection and fix tests