fixed error where only the first route would be checked