fixed bug when nested is nil