tm: check if the reply transaction is defined

closes #388

(cherry picked from commit 6150e8971c7c269a6a36e973ef2ee5435a7b0fb6)