Update the shared queries collection when a new query is created

Fixes #286.