revised login function
debugging user authetication process