Shifted the global boolean variable into the doGet() method