Fixed the issue of application getting crashed when changing orientation from Portrait to Landscape

Fixed the issue of application getting crashed when changing orientation
from Portrait to Landscape