properly handle function overriding