Fixed hang when change screen orientation.