fix entity map initialization with query