fix sighandler bug