added array support to replace