Fix for broken ref for variable