fix redirect not working. need to test more