fixed some upload bugs