The previous workaround has problem about accessing a variable without prior definition.
This change fix the problem.