Fixed problem with permissions and attachments