Add state checking