file upload and fixes