Prevent unnecessary queries.