fix small bug and improve Realm extension to be createOrUpdate(if missing)