added ability to handle lib functions overriding