fix errors for add_module, add sorting by time