Fixed options.type to options.format