fix mode change error