Add function add & update for the DAO