sort attachments to end