Fix menu generation js.