fixed indentation error in replace method