add code and spec to ensure redirect to root path if path invalid