fix wrong class check