Fixed Illegal state exception on rotation