fixed bug on inserting target, should not insert target for invalid transactions