added quitting functions