Fix exception on Ctrl-C 

Fix exception on Ctrl-C