fixed windows not closing, other fixes