check for attachment before attempting to save