fix(engine-rest) clone and replace