Added method to validate routes path
Validate route path before adding it to the stack