attachment logic update