support passing a non instance function to redirect