fixed some db stuff