-Added a loop for checking the activeness of program