A 'top modification' strategy for enhancing the ability of a chitosan aerogel to efficiently capture heavy metal ions.