modified redirect method