add html debug info.
optimize funtion call.