modify mainpage handler