fix some errors and add log model