Fix route path problem (undefined pathElement)