Changed some of the database stuff