Fixed a small error on close