use lazy match in flask version