support function as whitelist, Fixes #329.