Fixed and Refactory of Forward and Redirect functions