fix testing of which events affect which reflists
make ref from a query