Edited Login function (still not working)