modify the add method