fix a signal exit bug