Bug with introduce variable fixed
#SCL-6024 fixed
(cherry picked from commit 4b7ec54)
(cherry picked from commit b66df7b)