Added support for collapse and clear