Added level filtering for joinedWithClass function