added encoding check; now processing stata data