added attachments support with authentication
bug fixes