file upload: temporary fix DetachedInstanceError