fix unknown variable in case of an error