fix for issue #1189, missing variables added

bug fix for issue #1189.

@DeepDiver1975 thanks for reporting, please have a look at the patch.