Fixed functionality in login