add depth checks for counts