Fixing open/close bug;