handling tally(var, data=)