Proper query execution