change from exit() to bool-ret check