Added attachment validation