Adding security to the redirecting function process