used generatePath instead of path method