added err to callback