implemented QUIT mode