fixed duplicate attachment bug