Added signal handler to shutdown connection on ^C