Fix bug of extracting class