Added support for closing notebooks