fixed an obvious bug in solver