fixed update with session and also fixed bug with login.