added friendly_halt method