improve the appearing function of menu