error caused by missing tree depth fixed