only render collapse button when needed