Performace issue: removed the onIdle fn