adjusted sql in login