fixing while loop in unblock script