fixed, dlhandl.wait_stop call at wrong place