Made it so that ctrl + c can safely exit the script.