restore hide on close functionality