Implementation of restart and finish