Correct checkState by adding return