better clean_db script to ensure less than 5000 rows