fix small bug

fix the value function