Fix bug around state being modified by requests