unused var ref fix