fixed NEAR detection at beginning