added tests for replace