sort opening/closing on click