change up the meganav js function