replace method won't work and don't know why