added clean_by_item for clean_database.py
added database/disk cleaning if database/memory updating failed