The feedback network in the second opamp does nothing. R5 is connected like it was an output load, and the output is connected to Vin- either throught R4 or Q1. No difference in gain though. I see you intended to make R4/R5 a resistor divider as the feedback gain network. So then you should connect R4 between Vo and R5, and then to Vin-. Q1 can be placed, either shortcircuiting R4 for decreasing gain to 1, or between R5 and ground (i prefer this because then there is always the same voltage across Q1's gate and source), in the last case, gain control logic is reversed.