repaired sitegen replace functionality
merge with david