update $fn operator to catch errors
documentation for queries and operators