better dirty entity query support