added sqlite db support and table territory selection