Fixed issue where gui kept running after closing all forms