A race is under way to hand cash and other assets to younger generations ahead of a new inheritance tax levy on unspent pensions.The change next April is galvanising many families into making large gifts to avoid onerous death duties.But you need to be aware that there are obscure and costly traps which could catch you out.It is well known that you can give up to £3,000 a year free of inheritance tax (IHT), or unlimited sums that become exempt if you live for at least seven years.But setting up a trust is also becoming an increasingly popular way to beat IHT, which can significantly complicate matters.You risk the seven-year rule being extended for up to 14 years if you have created a discretionary trust to pass on wealth – and bungle the type and timing of your gifts.Here's what can go wrong and how you can ensure that your beneficiaries avoid being hit with an unexpected extra tax bill.How do trusts work?Trusts can be used for many purposes, including saving on IHT if you are wealthy enough to make it worthwhile. Inheritance tax is levied at 40 per cent above thresholds starting at £325,000 per person, or £500,000 if you leave a home to direct descendantsThey are a legal arrangement which allows assets to be managed and handed over for the benefit of one or more people.A 'settlor' puts the assets – such as land, property, shares and cash – into the trust. 'Trustees' look after them and 'beneficiaries' ultimately receive them.But there are layers of costs and taxes and it's important to get professional advice.Usually, as a settlor, you cannot continue to benefit from what has gone into a trust and still expect to avoid IHT. But you can exert control over how the money might be used. A discretionary trust allows you to retain leeway over anyone you deem too young, vulnerable or untrustworthy to handle large sums or assets – and you can be a trustee yourself.Before considering a trust or other measures, work out if your estate will be liable for IHT.It is levied at 40 per cent above thresholds starting at £325,000 per person, or £500,000 if you leave a home to direct descendants. Couples can double those thresholds because spouses are exempt from IHT.How the 14-year rule can catch you outThe seven-year rule can turn into the 14-year rule due to the different ways that gifts are assessed for tax if you are making them into a trust but also handing them over outright. Before considering a trust or other measures, work out if your estate will be liable for inheritance taxUnder the seven-year rule, a gift is technically known as a 'potentially exempt transfer' (PET).A gift into a discretionary trust is normally treated as a 'chargeable lifetime transfer' (CLT), which means it is assessed for IHT at the time, not after death. If it falls within your £325,000 nil-rate band, no upfront IHT has to be paid. But it is not forgotten and can still matter in the future.That earlier gift into the trust has to be taken into account if you make subsequent gifts direct to individuals which are subject to the seven-year rule.As these are PETs, if you die within seven years, the gifts 'fail' and IHT is chargeable.But the taxman will not only look back at the last seven years before death, but also at the seven years prior to PETs to see if earlier CLTs already used up any of your £325,000 nil-rate band.This is how a gift made into a trust nearly 14 years ago can still increase an overall IHT bill.How much might it cost you?Marianna Hunt is a personal finance specialist at wealth manager Fidelity International. She provides the following example to show how gift giving can go awry and result in a bigger IHT bill.Tim is divorced and eventually dies with an estate worth £1.8million. He put £325,000 into a discretionary trust for his grandchildren, which makes it a 'chargeable lifetime transfer'.Since the transfer is within his nil-rate band (£325,000), he didn't face an immediate IHT bill.Just under seven years later, Tim gave £325,000 directly to his daughter to help her to buy a larger home, and this was a 'potentially exempt transfer'. He died two years after making the gift to his daughter. Therefore her PET fails and becomes chargeable for inheritance tax unless it falls within Tim's nil-rate band.Tim made the gift into a trust nine years before his death, but because chargeable transfers in the seven years before the PET still count, it turns out that the gift has already used up Tim's entire £325,000 nil-rate band.So, Tim's £1.8million estate would be taxed at 40 per cent, with an IHT bill of £720,000.However, this isn't the end of it because since Tim made the earlier gift into a trust and then died within three years of making the second gift to his daughter, the latter is also taxed at 40 per cent.This is an extra £130,000 which increases the family's overall IHT bill to £850,000.Hunt says: 'It is worth stressing that HM Revenue & Customs is not simply imposing a new 14-year survival period on every gift. The ordinary rule for gifts made directly to individuals remains seven years.'The effective 14-year period comes about because two seven-year look-back periods can overlap.'How to avoid the 14-year ruleThere are precautions you can take to avoid falling foul of the 14-year rule.Hunt urges people to keep a clear record of what was given, to whom, on what date and whether a trust was involved.Secondly, she advises that you make sure that you understand whether a gift is a CLT or a PET before making it. This is because they may achieve similar family objectives but have very different inheritance tax consequences.Thirdly, she suggests that you consider leaving at least seven years and a day between a significant CLT and a subsequent PET – breaking them up so the taxman won't look back 14 years.Philip Lewis, head of financial planning advice at wealth manager Evelyn Partners, stresses the importance of the order and timing of gifts.He says: 'In some circumstances, making a PET before creating a trust, or ensuring gifts are spaced more than seven years apart, can potentially avoid the impact of the 14-year rule.'However, making gifts into a trust first may help to reduce future trust charges, such as periodic and exit fees, so there are pros and cons to both.'Lewis adds that as the rules are complex and outcomes depend on individual circumstances, professional advice is essential.Richard Paddle, private client adviser at wealth manager Isio, says: 'Well-intentioned estate planning can backfire when people mix trusts with later outright gifts.'It is important to separate large trust gifts and big outright gifts by at least seven years, keep detailed records of all lifetime gifts, and review plans regularly as rules and values can change.'