Added missing getState() function.