altered login function to test live db