Fix crash on Rest file