added support for clear() and open()