fix error when attaching new file