make sure we won't remove files if the database is not working
todo