rename private method to check depth