Catching KeyboardInterrupt
updated main()