1031 exchange is not completely free of tax when you receive cash or mortgage deduction. Of course when you satisifies 1031 deadline requirement, you will be able to defer some capital gain from tax. But if you receive cash or deduction in mortgage debt, the cash amount or reduction amount in debt will be taxable.
In order to achieve a completly tax free 1031 exchange, you have to trade "across or up", meaning trade into properties that are equal to or more than the value of the exchanged (old) properties.