added support for function objects