change signal handlers to sigaction