error processing is added to enterTurn function.