Updated signal handler