added replace support