change functor check, thanks to mutouyu