corrected errors on add()