improved attachment coutn
improved attachment icon
better error checking
better error checking