update query to handle multiple servers