Legal aid cuts risk miscarriages of justice