Fixed 'variable does not exist' error