fix condition to skip inheritance