added first matching mode