use correct referenced variables