fix nested class check