create megamd, support megamgateway, updates to nilavu