added set_connection() to force compile() to use a preset connection