fix exit problem