fixed attachment validation