fixed flag count and getAllTx recursion issues