fixed attach logic