Free the pin only after it is removed.