#35 - fix issue with incorrectly ended application