added pin_code expiration logic