fixed bug with wrong method being called in inheritance situations