Support custom quit handling