Fix NPE of enableWidgets