correct a bug with query (isnull)