handle orientations of device