Fix undefined reference variable when unallocating

The id variable was undefined in this context, we need to use
source.data('id').