Fix exit problem