fix upload condition problem