Added improved open state functionality.