add restart and keyboard handler