Added sighandler so that script can be killed gracefully.