Added extra class check