better handling of open/closed