fix scenario when the path points to a folder rather than layout
fix showing no nav bar
fix initial data