Change signal handling to sigaction