Added attachment detection