Added a short sleep before exiting as a quickfix to random crashing