poll for command finishing; removed 0.1s delays