Finally solved the correct problem.