fix global replace mess-up