added attach fun