Fixed problem with reference to functor