Fix uri swap crash