Updated render replace method