make update_parameters.sh script more robust