get rid of flickering on login redirect