Fixed typo: $stack -> $data