updated the add method