added locking table, two phase commiting hahah....