support for options.flatten is added