correct unpacking of Result