check that attachment id's are not undefined