Fixed database and userrepo