started quit function