fixed error in redirect, but redirect still not working ideally.