Fixes undefined variable error
Calls query and publishes initial result