small code change in solve