Bug fix on file uploading