added correctDepth