fix remove attachment bug