fix #160 SecurityException thrown out when running in sandbox mode with layout template