Fixed issue with app still running after close dialog