try moving from sleep to threading.Event().wait()
Merge branch 'v0.3' into v0.4