added implementation of collapsed