fixed login/logout (missing in tutorial)