added a signal handler