unify code with post_thread (see previous commit)
fix previous commit