added rtrim for generating route