bug fix in function get_vars.