fixed the code for redirect one handling