use tries to handle "CTRL-C" issue