add limit to number of levels