pin logic was fixed