added try/except/finally to handle keyboard interrupts. will clean up code in effort to use curses.wrapper in future update