rewrite the restart part