fix #158: User can do file IO in template when running in sandbox mode