attachment bug fixes