important fix that uses correct argument order (err === null)