Fixed a typo ($x -> $ex)

There is a typo at line 7:
$ex instead of $x