date causing some bugs, so move string replace to a loop