add code to judge and handle single page