Added functions to handle zTree