Hungary pledges to fix rule of law problems to secure EU funding