fix(wams): initialize modules object to save modules to

Before this modules object was undefined and modules were saved in
undefined, which raised the error