should work on mac and raspberry
adding the quit event