added termination signal handler