fixed error in solving odes