Changed transaction query logic