making addtomodel attribute an upsert process