fix pin mode not being set