chekc that attachment id's are not undefined