fix for issue #1189, missing variables added

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