Fixing 'using unaddressable value' error