modified fill_db