fix bug in solver