fix save attachments

fixes #239


@jancborchardt