fix file upload/delete/update code