Change mode with button not working properly, can't see why

I'm testing just using LEDs for the relay and opto pin so couldn't be that I guess.