login function fails