add locking around table creating and modification