Add attach logic