fixed small bug in solver