quit function created