Added functionality for open, close and toggle.