added orientation support