Adding a method to mark a query as dirty, using it to add extra logic
when a query internal state is altered