workaround bug in replace by regex