add support for customized function in config