rewrote getMethod() which returned the wrong method in some cases