changed attach method