Edit route Error function