fix loading and file upload