Updated login-functionality