fix replacement bug in turningBase