add log function and add stopped state in status function