set DATA_TYPE as soon as possible.
Merge pull request #1000 from iij/pr-set-data-type-asap

DATA_TYPE must be set as soon as possible