login flow + some fixes