Updated script to correctly submit values