Added server state switching and working racing