functions to clean up db entries