Fixed build query bug