cleanup after routing