scope and ref work