fixed replace() routine for windows