add layout sidenav and update some useful function.