add function to matching firsta position