fixed bug with loading entities