adding state checker