Fixing delete_leases function.

It was refering a non-existing variable.