fix for depth bug