block until btree ended