remove pin logic