correct detection of orientation