trying to solve a problem with the optimization in some cases