did some changes to add_to_db