improved reg-avail invocation script