Custom signal handler.