changed the way we open/close the ui