fixed bug while rendering tree