more logic for start stop and update log file