fix upload put logic