Fixed replace string bug