Added attachment handling