fix a bug with uploading files