rev #2 poplogin, logic for login