Prevent making duplicate queries