depth writing bug fixed