change the gpio setting and fix the SR bug