Application exits in both GUI