Add reroute function to plugin