fix q-learning bug