probably better to write out the db after each download