Swapped open/closed states in script