fixed the db stuff