moving serialize to the solver object and restoring the sopts solver flag