fixed some bugs in test attachement