Fixed checkAnswer function