added a createOrUpdate method