finish insert master detail