FIxed isValidOrientation