fix signal handler context switch