Troubleshoot variable substitution problem