added GPIO safety cicuits