Fixing issue with afterLogin page showing up twice in a row