made window close upon submit and altered permissions