procedure / event to cleanup the database