Fix isVertical check location