doing database and login