Added redirect functionality.