Added check for missing variable