fix portrait device detection