Updated login functionality 3