We changed the sequence of how data is added to the modules. First we make sure that files are created and then we add the module to the db.
When menu is added, it generates an ID that needs to up updated to the component module. Before we used to recover the module information via ->last and since the sequence of add change, we cannot do so.