fix bug in show-attachments javascript