Respond appropriately when application is brought down

Fixes #561

Signed-off-by: Ryan O'Hara <oharar@email.chop.edu>
Merge pull request #569 from ryanjohara/issue-526

Respond appropriately when application is brought down