undid changes to if statement and redirect