fix bug with rootObj optimization