change replace task logic