Fixed TypeError: Object 1 has no method 'replace'