fixing logout
small errors, added db creation to db class