changed to use sed without --in-place option