cleans up database