Fixes issue with variable updates