mode change + cleanup