fix redirect method