Fix for missing variable, thanks to wernisman