fix bugs indexHandler