fix bug in replace method