use check-types for validation and uses attachment object instead of path to file