Fixed sorting issue in Attachments