smooth out expand and collapse animation