Added protection against user killing the program