fixing end of solve