Updated login functionality 2