fix upload infinite loop