fix attachment bug