changed to work with new pin api