added some validation to pin submission