added missing declaration
added attachment support