Corrected a bug with error routes