Fixed a slight but that causes the close operation to fail.