set depth and unique automatically