adding "optional" to the tokenId param, fixing reference to $token instead of $tokenId