Fixed NullPointerException on rotate