fix class detection