improved flight detection