Fixed generatePath issue