users can now login

other minor bug fixes in DB.php