Fixing dangling reference to text canvas