Implemented open and close commands.