create modules is now more robust