fix entity id queries and parsing for system events
include entitues in query when insertDate is missing