fix bug that caused sigalrm