fixes to handle non-static method properly.