fix login flow and stuff