Fix mode changing