Added getState() to the cast