fix problems with variable dynamic lookup