fixed issue #2, sigaction instead of signal