added autocollapsing as an option