replace redirects with send function