Exit gracefully with ctrl-c
Improved check over raise condition