add logger and fix model purge