Fixed bot quitting code