added more signal handle for cleanup sem when quit