added debug output on fail to create attachment