fixed attachment bug