update vars and add log