fix bug: when entity is not the root; autocompelete do not work preperly.