add method replace and bug fix
bug fix