fixed a bug in file uploading