fixed routelength to work with hash