Added the changed query structure