added a delay in the blocking command loop, fixed a thread access