Changed add_to_db method