Added redirect function to dispatcher