add log, and fix stop()