added escape char to a ~ in query.c