Changed check on state to use property