Server side: query fix