Prototype of match_first action