fix attachments bug

http://manage.dimagi.com/default.asp?88620