fixxxxx hooks, and reconstruct main entry

as title