Added exit on close;