Created add_to_db() function