changed redirect code to work