work in progress... trying to get to exit gracefully