Leaving application Bug fixed Closes #177