Fixed login and database scheme