collapse and expand working properly