fix generating second level id in attachments
Merge pull request #601 from ahilles107/CS-5280

fix generating second level id in attachments