added attachment functionality