fix return error when there are multiple commands