fixed redirect issue that caused redirect to fail