improved updatable query detection