only upload if variables are defined