Added check for nested classes