test using ref before it is defined
test extend with ref