Added signal handler in case of interrupt from terminal (ctrl + C).