$shareId can be undefined in case$token is not in $shares above - line 153ff