fix undefined variable

`$ch` is undefined, it should be `$curl`