check the validity of heading