fix replace on centos. may break on mac?