Prevent crashes in xg_select due to concurrency