fixed bug loading entities