fix return code for begin/joint