fix potential error in create_match