add the signal handler part