optimize the signin redirect