0 if null for queries