updated orientation handling