updated realm script