safe quit(), updated demo