fixed NPE in mode
Merge branch 'mode-hotfix'