changed to allow only one element to be open at a time, clicking on an open one ensures that all others are closed first