fixed a bug in match method, now resolves methods correctly