Added flexibility to quit hooks