Added client's state checking