add check for class exists