Changed position of query execution