Modified code for getState method in ACImpl class