fixed NPE when rotating