fix sign bug in add_solution