fix 'variable not available' errors