fix log and code