updated condition to find classes