added check for enum vars
make closest hit check to be reference