use $$input() instead, if the user cancels, it will stop the script (halt) at the $input request.