Repairing detachPin bug