error checking for setting collapsed