Fixed disarming bug, use flag instead of mode switch