// fixed subtle bug with regexp replacement