be more safe about accessing the database
finished db cleanup