changing to work with new pin API