updated signal handler