added tests and attachment feature